home *** CD-ROM | disk | FTP | other *** search
/ Personal Computer World 2007 September / PCWSEP07.iso / Software / Linux / Linux Mint 3.0 Light / LinuxMint-3.0-Light.iso / casper / filesystem.squashfs / etc / acpi / ibm-wireless.sh < prev    next >
Encoding:
Linux/UNIX/POSIX Shell Script  |  2007-03-29  |  629 b   |  27 lines

  1. #!/bin/sh
  2. # Find and toggle wireless of bluetooth devices on ThinkPads
  3.  
  4. . /usr/share/acpi-support/state-funcs
  5.  
  6. BLUETOOTH=/proc/acpi/ibm/bluetooth
  7.  
  8. if [ -r $BLUETOOTH ]; then
  9.     grep -q disabled $BLUETOOTH
  10.     bluetooth_state=$?
  11. fi
  12.  
  13. # Note that this always alters the state of the wireless!
  14. toggleAllWirelessStates;
  15.  
  16. # Sequence is Both on, Bluetooth only, Wireless only, Both off
  17. if ! isAnyWirelessPoweredOn; then
  18.     # Wireless was turned off
  19.     if [ -w $BLUETOOTH ]; then
  20.         if [ "$bluetooth_state" = 0 ]; then
  21.             echo enable > $BLUETOOTH;
  22.         else
  23.             echo disable > $BLUETOOTH
  24.         fi
  25.     fi
  26. fi
  27.